<%--
  Created by IntelliJ IDEA.
  User: 长沙吴亦凡
  Date: 2021/12/18
  Time: 14:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }

        .title{
            color: red;
            text-align: center;
        }

        #box{
            height: 300px;

            /*实现居中对齐的代码*/
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
        }

        .opr{
            border: 1px solid black;
        }
        
        .opr .add{
            text-align: right;
        }
    </style>
</head>
<body>
    <div id="box">
        <h1 class="title">学员信息列表</h1>
        <div class="opr">
            <a class="add" href="/toAddStu">添加学员</a>
            <table class="table" border="1" cellspacing="0" cellpadding="5">
                <tr>
                    <th>编号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>电话</th>
                    <th>邮箱</th>
                    <th>班级</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${pageInfo.list}" var="student">
                    <tr>
                        <td>${student.id}</td>
                        <td>${student.name}</td>
                        <td>${student.gender}</td>
                        <td>${student.age}</td>
                        <td>${student.telephone}</td>
                        <td>${student.email}</td>
                        <td>${student.className}</td>
                        <td>
                            <a href="/toUpdStu?id=${student.id}">修改</a>
                            <a href="/delStu?id=${student.id}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            第${pageInfo.pageNum}页/共${pageInfo.pages}页
            <a href="/getStudents?pageNum=1">首页</a>
            <c:if test="${pageInfo.hasPreviousPage}">
                <a href="/getStudents?pageNum=${pageInfo.pageNum-1}">上一页</a>
            </c:if>
            <c:forEach begin="1" end="${pageInfo.pages}" step="1" var="i">
                <a href="/getStudents?pageNum=${i}">${i}</a>
            </c:forEach>
            <c:if test="${pageInfo.hasNextPage}">
                <a href="/getStudents?pageNum=${pageInfo.pageNum+1}">下一页</a>
            </c:if>
            <a href="/getStudents?pageNum=${pageInfo.pages}">尾页</a>
        </div>
    </div>
</body>
</html>
